<!DOCTYPE html>
<html>

<head>
    <title>海角论坛</title>
    <meta charset="UTF-8">

    <link rel="shortcut icon" type="images/jpeg" href="../images/hai-logo.jpg" />
    <link rel="stylesheet" type="text/css" href="../css/base.css">
    <link rel="stylesheet" type="text/css" href="../css/login.css">
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="../css/animate.min.css">
    <link rel="stylesheet" href="../css/video.css">
    <style>
        form {
            position: relative;
        }
        
        #regi-username-error {
            position: absolute;
            top: 11px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
        
        #regi-email-error {
            position: absolute;
            top: 61px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
        
        #regi-password-error {
            position: absolute;
            top: 111px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
        
        #regi-password-confirm-error {
            position: absolute;
            top: 161px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
        
        #login-email-error {
            position: absolute;
            top: 13px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
        
        #login-password-error {
            position: absolute;
            top: 61px;
            right: 6px;
            font-size: 14px;
            color: #c33;
        }
    </style>
</head>

<body>
<div class="videocontainer">
    <video class="fullscreenvideo" poster="__ROOT__/Themes/tdt/Asset/images/loginbg.jpg" id="bgvid" playsinline="" autoplay="true" muted="false" loop="true">
        <source src="../video/haijiao.mp4" type="video/mp4">
    </video>
</div>
    <div class="moneybox" id="leafContainer"></div>
    <div id="WebGL-output"></div>
    <div id="Stats-output"></div>
    <div class="wrap ">

        <header>
            <h1>海角论坛</h1>
            <h5>自由,开放的社交论坛</h5>
            <p>在海角认识世界</p>
        </header>

        <section> 
            <ul>
                <li id="registerHeader ">手机</li>
                <li id="loginHeader " class="active-header ">密码</li>
            </ul>
            <div style="display: none; ">
                <form id="registerForm">
                    <div class="inputs ">
                        <input type="text " name="phone " id="logPhone" placeholder="手机号" autocomplete="off">
                        <input type="text " name="yanzm " id="yanzm" placeholder="验证码" autocomplete="off">
                        <span id="regi-username-error"></span>
                        <span id="regi-email-error"></span>
                    </div>
                </form>
                <h6>没有账号,快来<span style="color: blue" onclick="tobackreg()">注册</span></h6>
                <br>
                <button id="phoneButton" type="button ">登录</button>
                <h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----copyright@2019海角-----</h5>
            </div>
            <div id="login-container">
                <form id="loginForm">
                    <div class="inputs ">
                        <input type="text" name="name" id="logName" placeholder="账号" autocomplete="new-name">
                        <input type="password" name="password" id="logPassword" placeholder="密码 " autocomplete="new-password">
                        <span id="login-email-error "></span>
                        <span id="login-password-error "></span>
                    </div>
                    <h6>没有账号,快来<span style="color: blue" onclick="tobackreg()">注册</span></h6>
                    <br>
                    <button id="pwdButton"  >登录</button>
                    <!-- <div id="wb_connect_btn ">weiboLogin</div> --> 
                    <h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----copyright@2019海角-----</h5>
                </form>
            </div>
        </section>
    </div>

    <!--基础js-->
    <script type="text/javascript " src="../js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript " src="../layer/2.4/layer.js"></script>
    <script type="text/javascript " src="../js/login.js "></script>
    <script type="text/javascript " src="../js/jwt.js"></script>

    <script>

        $(()=>{
            $("#pwdButton").click(()=>{
                var user = logName.val();
                var pwd = logPassword.val();
                alert("点我");

                $.ajax({
                    url: "/dladmin",
                    type: "post",
                    data: {
                        user: user,
                        pwd: pwd
                    },
                    dataType: 'text',
                    success: function(data) {
                        if (data){
                            console.log(data)
                            headers:setJwtToken(data);
                            alert(data);
                            location.href='backindex.html';

                        } else {
                            alert("用户名或者密码错误");
                        }
                    },
                });
            });


        })




       /* function tobackreg() {
            location.href = 'backregister.html';
        }*/
    </script>

</body>

</html>